/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "indicador_pregunta")
@NamedQueries({@NamedQuery(name = "IndicadorPregunta.findByIndCod", query = "SELECT i FROM IndicadorPregunta i WHERE i.indCod = :indCod"), @NamedQuery(name = "IndicadorPregunta.findByIndPregunta", query = "SELECT i FROM IndicadorPregunta i WHERE i.indPregunta = :indPregunta")})
public class IndicadorPregunta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "IND_COD", nullable = false)
    private Integer indCod;
    @Column(name = "IND_PREGUNTA")
    private String indPregunta;
    @JoinColumn(name = "ARE_COD", referencedColumnName = "ARE_COD")
    @ManyToOne
    private AreaIndic areCod;
    @JoinColumn(name = "TPB_COD", referencedColumnName = "TPB_COD")
    @ManyToOne
    private TipoPoblacion tpbCod;

    public IndicadorPregunta() {
    }

    public IndicadorPregunta(Integer indCod) {
        this.indCod = indCod;
    }

    public Integer getIndCod() {
        return indCod;
    }

    public void setIndCod(Integer indCod) {
        this.indCod = indCod;
    }

    public String getIndPregunta() {
        return indPregunta;
    }

    public void setIndPregunta(String indPregunta) {
        this.indPregunta = indPregunta;
    }

    public AreaIndic getAreCod() {
        return areCod;
    }

    public void setAreCod(AreaIndic areCod) {
        this.areCod = areCod;
    }

    public TipoPoblacion getTpbCod() {
        return tpbCod;
    }

    public void setTpbCod(TipoPoblacion tpbCod) {
        this.tpbCod = tpbCod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (indCod != null ? indCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IndicadorPregunta)) {
            return false;
        }
        IndicadorPregunta other = (IndicadorPregunta) object;
        if ((this.indCod == null && other.indCod != null) || (this.indCod != null && !this.indCod.equals(other.indCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.IndicadorPregunta[indCod=" + indCod + "]";
    }

}
